package com.leyou.item.api;

import com.leyou.item.pojo.Category;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
@RequestMapping("/category")
public interface CategoryApi {

    /**
     * 根据父节点的id查询子节点集合列表
     * @param pid
     * @return
     */
    @GetMapping("/list")
    public List<Category> queryCategoriesByPid(@RequestParam(value = "pid", defaultValue = "0") Long pid) ;

    /**
     * 通过品牌id查询中间表获得商品分类列表
     * @param bid
     * @return
     */
    @GetMapping("bid/{bid}")
    public List<Category> queryByBrandId(@PathVariable("bid") Long bid);
    /**
     * 通过ids查询商品分类名
     * @param ids
     * @return
     */
    @GetMapping
    public List<String> queryNamesByIds(@RequestParam("ids")List<Long> ids);
}